/*
 * @Descripttion: 
 * @version: 
 * @Author: LiuXuFei
 * @Date: 2021-12-09 09:45:09
 * @LastEditors: LiuXuFei
 * @LastEditTime: 2021-12-09 17:34:11
 */
// #ifndef VUE3
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
// #endif

// #ifdef VUE3
import { createStore } from 'vuex'
const store = createStore({
// #endif
	state: {
		stockDetails:[],  //所有库存数据
		// hasLogin: false,  //登录状态
		userinfo: {},	  //用户信息
		region:[],
	},
	mutations: {
		/* 登录状态 */
		login(state,userinfo){
			// state.hasLogin = true
			state.userinfo = userinfo
			uni.setStorageSync('userinfo',userinfo)
		},
		/* 退出登录 */
		logout(state,userinfo){
			// state.hasLogin = false
			state.userinfo = {}
			uni.removeStorageSync('userinfo')
	
		}
	},
	getters: {

	},
	actions: {
		// lazy loading openid
		
	}
})

export default store
